Next | Prev | Up | Top | Contents | Index
Sending a Process Signal
In traditional UNIX kernels, a device driver identified the current user process by the address of the proc_t structure that the kernel uses to represent a process. Direct use of the proc_t is no longer supported by IRIX. The reason is that the contents of the proc_t change from release to release, and also differ between 64-bit and 32-bit kernels.
The most common use of the proc_t by a driver was to send a signal to the process. This capability is still supported. To do it, take three steps:
- Call proc_ref() to get a process handle, a number unique to the current process. The returned value must be treated as an arbitrary number (in some releases of IRIX it was the proc_t address, but this is not the defined behavior of the function.)
- Use the process handle as an argument to proc_signal(), sending the signal to the process.
- Release the process handle by calling proc_unref().
The third step is important. In order to keep the process handle valid, IRIX retains information about the process to which it is related. However, that process could terminate (possibly as a result of the signal the driver sends) but until the driver announces that it is done with the handle, the kernel must try to retain process information.
It is especially important to release a process handles before unloading a loadable driver (see "Entry Point unload()").
Next | Prev | Up | Top | Contents | Index